from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient

class InboundTest(TestCase):
    def setUp(self):
        self.client = APIClient()
        self.client.login(username='admin', password='admin123')

    def test_create_inbound(self):
        response = self.client.post(reverse('inbound-list'), {
            "document_number": "INB-TEST-001",
            "warehouse": 1,
            "details": [{"material": 1, "quantity": 50}]
        })
        self.assertEqual(response.status_code, 201)